#include "../../include/car_parts/lcd.h"

LCD::LCD()
{
    this->size = 11.6;
    this->model = "super";
}

void LCD::setSize(double size)
{
    this->size = size;
}

void LCD::setModel(const std::string &model)
{
    this->model = model;
}

// 屏幕输出
void LCD::print()
{
    std::cout << "**液晶显示屏模块**"
              << "\n显示屏型号: " << model << "\n显示屏尺寸: " << size << std::endl;
}
// 本地文件保存
void LCD::save(const std::string &filename)
{
    // 打开一个输出文件流
    std::ofstream file(filename, std::ios::app);
    if (!file.is_open())
    {
        std::cout << "未找到文件！" << std::endl;
        return;
    }

    file << "," << model << "," << size;

    // 关闭文件流
    file.close();
}